
{extend name="index@common/base"/} 
{block name="style"}
{/block} {block name="body"}
<div class="layui-body layui-tab-content index-body" id="cont">
	<div class="park-navigation">
		<div class="navigation-icon">
			<i class="fa {$breadCrumb[0]['icon']}"></i>
		</div>
		<div class="navigation-menu">
			<h2>{$breadCrumb[0]['title']}</h2>
			{if isset($breadCrumb[1])}
			<p>{$breadCrumb[1]['title']}</p>
			{/if}
		</div>
	</div>
	<div class="park-content">
		<div class="content-title">
			<div class="title col-8">
				<h3>{$breadCrumb[1]['title']}</h3>
				<form class="layui-form"  action="{:url('duty/news/search')}" onsubmit="return false;">
					<button class="search-btn" lay-submit lay-filter="search"><img src="__STATIC__/img/base/topsearch01.png"></button>
					<input class="search-input" name="keyword" type="text" placeholder="标题" id="keyword"  autocomplete="off">
					<div class="date-duration">
                       <div class="layui-input-inline">
							<input type="text" name="start" id="start" autocomplete="off" class="search-input" placeholder="开始日期">
						</div>
						<div class="layui-input-inline">
							<span>--</span>
						</div>
						<div class="layui-input-inline">
							<input type="text" name="end" id="end" autocomplete="off" class="search-input" placeholder="截止日期">
						</div>
                   </div>
				</form>	
			</div>
			<div class="tool col-2">
				<button id="add"  data-url="{:url('duty/news/add')}"><i class="fa fa-plus"></i></button>
				<button id="reload"><i class="fa fa-refresh"></i></button>
			</div>
		</div>
		<table class="layui-hide" id="news" lay-filter="news" data-url="{:url('duty/news/index')}"></table>
	</div>
</div>
{/block}
{block name="script"}

<script type="text/javascript" src="__JS__/duty/news.js"></script>

<script type="text/html" id="sendTime">
	{{#  
 		 var fn = function(nS){
  		 return new Date(parseInt(nS) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " "); 
		  }; 
	}}
	{{# if (d.sendTime){ }}
	  {{fn(d.sendTime)}}
	{{# } }}
	
</script>


<script type="text/html" id="user">
	
	{{d.user.userName}}
	
</script>

<script type="text/html" id="detail">
	
	<a  data-url="{:url('duty/news/detail')}?newsId={{d.id}}" id="detail" href="#"  style="color:#1e9fff">{{d.title}}</a>
	
</script>
<script type="text/html" id="status">
	<div>
		{{# if (d.isValid == 1){ }}
		<p>有效性: <span class="layui-badge-circle layui-bg-green"><i class="fa fa-check"></i></span></p>
		{{# }else{ }}
		<p>有效性: <span class="layui-badge-circle layui-bg-red"><i class="fa fa-close"></i></span></p>
		{{# } }}
	</div>
</script>
<script type="text/html" id="check">
	<div>
	{{# if (d.checkStatus == 1){ }}
		<p class="badge-audit-state pending-approval"></p>
	{{# } }}
	{{# if (d.checkStatus == 2){ }}
		<p class="badge-audit-state under-review"></p>
	{{# } }}
	{{# if (d.checkStatus == 3){ }}
		<p class="badge-audit-state check-success"></p>
	{{# } }}
	</div>
</script>
<script type="text/html" id="toolDemo">
	<div>
		<a class="layui-btn btn-edit" lay-event="edit" id="edit_{{d.id}}" data-url="{:url('duty/news/edit')}?newsId={{d.id}}"><i class="fa fa-pencil"></i></a>
  		<a class="layui-btn btn-del" lay-event="del"  id="del_{{d.id}}" data-url="{:url('duty/news/del')}?newsId={{d.id}}"><i class="fa fa-trash"></i></a>
		{{# if (d.checkStatus == 1 ){ }}
			<a class="layui-btn btn-audit" lay-event="audit" id="audit_{{d.id}}" data-url="{:url('duty/news/audit')}" data-id="{{d.id}}"><i class="fa fa-file-text"></i></a>
		{{# } }}
	</div>
</script>
{/block}

